From Curt: tpo read fixes.
authorrobertl <robertl>
Sat, 9 Sep 2006 01:51:43 +0000 (01:51 +0000)
committerrobertl <robertl>
Sat, 9 Sep 2006 01:51:43 +0000 (01:51 +0000)
tpo.c

diff --git a/tpo.c b/tpo.c
index b3bc3ff085b34b07cf97ba2ad6c47350a1d9b802..8a3fed2b35b54cfa6400256ca2daf10dbaeb6835 100644 (file)
--- a/tpo.c
+++ b/tpo.c
@@ -864,6 +864,7 @@ void tpo_process_waypoints(void)
 //UNKNOWN DATA LENGTH
         // Fetch name length
         name_length = tpo_read_int();
+//printf("\nName Length: %d\n", name_length);
         if (name_length) {
             waypoint_name = xmalloc(name_length+1);
             waypoint_name[0] = '\0';
@@ -874,7 +875,7 @@ void tpo_process_waypoints(void)
             waypoint_name = xmalloc(15);
             sprintf(waypoint_name, "WPT %d", ii+1);
         }
-//printf("Waypoint Name: %s\n", waypoint_name);
+//printf("\tWaypoint Name: %s\n", waypoint_name);
 
 //UNKNOWN DATA LENGTH
         (void)tpo_read_int();
@@ -893,11 +894,12 @@ void tpo_process_waypoints(void)
         if (altitude == 0xfffd000c) // Unknown altitude
             altitude = 0;
         waypoint_temp->altitude = altitude / 100;   // Meters
-//printf("Altitude: %d\n", waypoint_temp->altitude);
+//printf("\tAltitude: %1.0f meters\n", waypoint_temp->altitude);
 
 //UNKNOWN DATA LENGTH
         // Fetch comment length
         name_length = tpo_read_int();
+//printf("\tComment length: %d\n", name_length); 
         if (name_length) {
             char *comment;
  
@@ -906,7 +908,7 @@ void tpo_process_waypoints(void)
             tpo_fread(comment, 1, name_length, tpo_file_in);
             comment[name_length] = '\0';  // Terminator
             waypoint_temp->description = comment;
-//printf("Comment: %s\n", waypoint_name);
+//printf("\tComment: %s\n", waypoint_name);
         }
         else {
 //            waypoint_temp->description = NULL;
@@ -927,16 +929,20 @@ void tpo_process_waypoints(void)
         waypt_add(waypoint_temp);
 
 //UNKNOWN DATA LENGTH
-        (void)tpo_read_int();
+//        (void)tpo_read_int();
+       (void)tpo_read_8();
 
 //UNKNOWN DATA LENGTH
-        (void)tpo_read_int();
+//        (void)tpo_read_int();
+       (void)tpo_read_8();
 
 //UNKNOWN DATA LENGTH
-        (void)tpo_read_int();
+//        (void)tpo_read_int();
+       (void)tpo_read_8();
 
 //UNKNOWN DATA LENGTH
-        (void)tpo_read_int();
+//        (void)tpo_read_int();
+       (void)tpo_read_8();
     }
 }